import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		count: 0,
		isShow: false,
		shoppingCar: [],
		user: {uname: '无',upwd: '无',usex: '无',uid:'无'},
		loginFlag: false
	},
	mutations: {
		addShoppingCar(state,good){
			state.shoppingCar.push(good);
		},
		addUser(state,user){
			state.user= user;
		},
		setLoginFlag(state,f){
			state.loginFlag=f;
			window.localStorage.setItem('loginFlag',f);
		}
	},
	getters: {
		
	},
	actions: {
		
	}
});

export default store;